/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.webos.java.sessinfo;

import org.webos.java.base.Application;
import org.webos.java.base.ApplicationType;
import org.webos.java.base.Session;
import org.webos.java.base.workspace.FrameHolder;
import org.webos.java.base.workspace.Splitter;
import org.webos.java.base.workspace.Workspace;

/**
 *
 * @author kostya
 */
@ApplicationType(name="Session Info", code="sess", jsClass="sessinfo.Application", 
        description="Provides information about active sessions", icon="sessinfo_icon")
public class SessionsInfo extends Application{

    protected ChatHistory chatHistory = null;
    protected SessionList sessionList = null;

    public SessionsInfo(Session aSession) {
        super(aSession);
        Splitter sp = new Splitter(null, "main");
        sp.setVertical(true);
        sp.setRatio(0.6);
        Workspace ws = new Workspace(this, "main");
        ws.setItem(sp);
        ws.setCaption("Sessions");
        FrameHolder fh0 = new FrameHolder(sp, "fh0");
        sp.setLeftItem(fh0);
        FrameHolder fh1 = new FrameHolder(sp, "fh1");
        sp.setRightItem(fh1);
        chatHistory = new ChatHistory(this, ws);
        sessionList = new SessionList(this, ws);
        fh0.addFrame(sessionList);
        fh1.addFrame(chatHistory);
        addWorkspace(ws);
        addFrame(sessionList);
        addFrame(chatHistory);
        showWorkspace(ws);
    }
}
